<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <h2>透传属性</h2>
      <!-- 当父组件的子组件标签传递了自定义的属性，但是在子组件没有使用props进行接收 -->
      <!-- 传递的那个属性，就会自动的添加到子组件的根元素上面 -->
      <!-- 如果子组件有多个根元素，那么透传属性是无效的 -->
      <!-- 了解 -->
      <child name="zhangsan" id="box" class="cls2"></child>
    </div>

    <script src="./lib/vue3.js"></script>
    <script>
      const { createApp } = Vue;
      const Child = {
        // props: {
        //   name: String,
        // },
        template: `
          <div class="cls1">1111</div>
          <div>这是child子组件</div>
        `,
      };

      const app = createApp({
        components: {
          Child,
        },
      });

      app.mount("#app");
    </script>
  </body>
</html>
